
enum ECharge_t {
  kPositive,
  kNegative,
  kNCharges
};
const Char_t *chargeName[kNCharges] = {
  "positive",
  "negative"
};

/*
	fGF = TrackingEff_geantflukaCorrection(ipart, icharge);
	if (useGFcorrection)
	  hEff->Divide(fGF);
 */

//Alex: It turns out that the absorption cross-sections for anti-protons which are implemented in GEANT3 are significantly larger than those observed in measurements
//K. Aamodt et al. (ALICE Collaboration), Midrapidity antiproton-to-proton ratio in pp collisons at sqrt(s)=0.9 TeV and 7 TeV measured by the ALICE experiments, Phys. Rev. Lett., vol. 105, p. 072002, 2010.
//overestimate absorption
//underestimate efficiency
//over correction of efficiency
// should * f, f<1


//http://alisoft.cern.ch/viewvc/trunk/PWGLF/SPECTRA/PiKaPr/TOF/PbPb276/macros/TrackingEff.C?view=markup&root=AliRoot

TF1 *
TrackingEff_geantflukaCorrection(Int_t ipart, Int_t icharge)
{
  TF1 *f = 0x0;
  if (ipart == 4 && icharge == kNegative) {
    //TrackingPtGeantFlukaCorrectionPrMinus(x)
    f = new TF1(Form("fGeantFluka%s%s", AliPID::ParticleName(ipart), chargeName[icharge]), "(1 - 0.129758 *TMath::Exp(-x*0.679612))", 0., 50.);
  }
  else if (ipart == 3 && icharge == kNegative) {
    //"TrackingPtGeantFlukaCorrectionKaMinus(x)
    f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), chargeName[icharge]), "TMath::Min((0.972865 + 0.0117093*x), 1.)", 0., 5.);
  }
  else{
    printf("fluka wrong ipart and icharge!! %d %d\n", ipart, icharge); exit(1);
  }
  return f;
}

